{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on package tensorflow:\n",
      "\n",
      "NAME\n",
      "    tensorflow\n",
      "\n",
      "DESCRIPTION\n",
      "    # Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n",
      "    #\n",
      "    # Licensed under the Apache License, Version 2.0 (the \"License\");\n",
      "    # you may not use this file except in compliance with the License.\n",
      "    # You may obtain a copy of the License at\n",
      "    #\n",
      "    #     http://www.apache.org/licenses/LICENSE-2.0\n",
      "    #\n",
      "    # Unless required by applicable law or agreed to in writing, software\n",
      "    # distributed under the License is distributed on an \"AS IS\" BASIS,\n",
      "    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
      "    # See the License for the specific language governing permissions and\n",
      "    # limitations under the License.\n",
      "    # ==============================================================================\n",
      "\n",
      "PACKAGE CONTENTS\n",
      "    app (package)\n",
      "    bitwise (package)\n",
      "    compat (package)\n",
      "    compiler (package)\n",
      "    contrib (package)\n",
      "    core (package)\n",
      "    data (package)\n",
      "    debugging (package)\n",
      "    distributions (package)\n",
      "    dtypes (package)\n",
      "    errors (package)\n",
      "    examples (package)\n",
      "    feature_column (package)\n",
      "    gfile (package)\n",
      "    graph_util (package)\n",
      "    image (package)\n",
      "    initializers (package)\n",
      "    io (package)\n",
      "    keras (package)\n",
      "    layers (package)\n",
      "    linalg (package)\n",
      "    logging (package)\n",
      "    losses (package)\n",
      "    manip (package)\n",
      "    math (package)\n",
      "    metrics (package)\n",
      "    nn (package)\n",
      "    profiler (package)\n",
      "    python (package)\n",
      "    python_io (package)\n",
      "    quantization (package)\n",
      "    resource_loader (package)\n",
      "    saved_model (package)\n",
      "    sets (package)\n",
      "    sparse (package)\n",
      "    spectral (package)\n",
      "    strings (package)\n",
      "    summary (package)\n",
      "    sysconfig (package)\n",
      "    tensorboard (package)\n",
      "    test (package)\n",
      "    tools (package)\n",
      "    train (package)\n",
      "    user_ops (package)\n",
      "\n",
      "SUBMODULES\n",
      "    estimator\n",
      "    flags\n",
      "    pywrap_tensorflow\n",
      "\n",
      "DATA\n",
      "    COMPILER_VERSION = 'MSVC'\n",
      "    GIT_VERSION = \"b'unknown'\"\n",
      "    GRAPH_DEF_VERSION = 22\n",
      "    GRAPH_DEF_VERSION_MIN_CONSUMER = 0\n",
      "    GRAPH_DEF_VERSION_MIN_PRODUCER = 0\n",
      "    QUANTIZED_DTYPES = frozenset({tf.qint8, tf.quint8, tf.qint32, tf.qint1...\n",
      "    VERSION = '1.2.1'\n",
      "    __compiler_version__ = 'MSVC'\n",
      "    __git_version__ = \"b'unknown'\"\n",
      "    bfloat16 = tf.bfloat16\n",
      "    bool = tf.bool\n",
      "    complex128 = tf.complex128\n",
      "    complex64 = tf.complex64\n",
      "    double = tf.float64\n",
      "    float16 = tf.float16\n",
      "    float32 = tf.float32\n",
      "    float64 = tf.float64\n",
      "    half = tf.float16\n",
      "    int16 = tf.int16\n",
      "    int32 = tf.int32\n",
      "    int64 = tf.int64\n",
      "    int8 = tf.int8\n",
      "    newaxis = None\n",
      "    qint16 = tf.qint16\n",
      "    qint32 = tf.qint32\n",
      "    qint8 = tf.qint8\n",
      "    quint16 = tf.quint16\n",
      "    quint8 = tf.quint8\n",
      "    resource = tf.resource\n",
      "    string = tf.string\n",
      "    uint16 = tf.uint16\n",
      "    uint8 = tf.uint8\n",
      "\n",
      "VERSION\n",
      "    1.2.1\n",
      "\n",
      "FILE\n",
      "    f:\\anaconda\\envs\\tensorflow\\lib\\site-packages\\tensorflow\\__init__.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import pandas as pd\n",
    "import helper as hp\n",
    "import tensorflow as tf\n",
    "help(tf)\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dir = 'Novelty.txt'\n",
    "text = hp.load_text(dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with open('Novelty.txt',\"r\") as f:\n",
    "    str = f.read()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'text' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-4-d0557adf9a27>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[0mnum\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m100\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mtext\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtext\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0mnum\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'text' is not defined"
     ]
    }
   ],
   "source": [
    "num = 100\n",
    "text = text[:num]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "str = str[:num]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "lines_of_text = str.split('\\n')\n",
    "print(len(lines_of_text))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
